/**
 * 
 */
package cc.telecomdigital.tdstock.activity.groups.more.push.util;

import cc.telecomdigital.tdstock.ProgressDialog;
import cc.telecomdigital.tdstock.R;
import cc.telecomdigital.tdstock.SystemInfo;
import cc.telecomdigital.tdstock.Framework.UniqueItem.TDStockLog;
import cc.telecomdigital.tdstock.activity.groups.monitor.util.HttpHelper;
import android.content.Context;
import android.os.AsyncTask;

/**
 * 
 * Project：tdstock3
 * Package：cc.telecomdigital.tdstock.activity.groups.more.push.util
 * Class：MessageContent Description： Creater：hunter CreateTime：Oct 14, 2011
 * 9:35:36 AM Modifier ：hunter Modify time：Oct 14, 2011 9:35:36 AM Modify
 * Remarks： 开启线程，判断进入，消息详细：消息列表
 * 
 * @version
 * 
 */
public class MessagePushAsyncTask extends AsyncTask<String, String, Void>
{
	private final static String	TAG	= MessagePushAsyncTask.class
										.getSimpleName();
	private String				_message_type_id;
	private String				_message_id;
	private Context			context;
	private ProgressDialog		dd;

	/**
	 * 消息详细
	 * 
	 * @param context
	 * @param id
	 */
	public MessagePushAsyncTask(Context context, String messagetypeid,
			String id)
	{
		this.context = context;
		this._message_type_id = messagetypeid;
		this._message_id = id;
		dd = new ProgressDialog(context, context.getString(R.string.downing));
	}

	public String getUrl()
	{
		if (!SystemInfo.isNetworkingConnected(context))
		{
			return "";
		}
		String url = HttpHelper.isServerAvaiable(Data
				.getMessagePushContentURL(context, _message_type_id,
						_message_id), context, 1);
		TDStockLog.d(TAG, url == null ? "url is null" : url);
		return url;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.os.AsyncTask#doInBackground(Params[])
	 */
	@Override
	protected void onPreExecute()
	{
		// TODO Auto-generated method stub
		super.onPreExecute();
		dd.show();
	}

	// @Override
	/*
	 * protected void onPostExecute(String result) { // TODO Auto-generated
	 * method stub super.onPostExecute(result); ProgressDialog.dismissAll(); }
	 */

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.os.AsyncTask#doInBackground(Params[])
	 */
	@Override
	protected Void doInBackground(String... params)
	{
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected void onPostExecute(Void result)
	{
		// TODO Auto-generated method stub
		super.onPostExecute(result);
		ProgressDialog.dismissAll();
	}
}
